<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Vuepress博客相关配置 | KTBlog</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/KTblogs/favicon.ico">
    <meta name="description" content="正在努力加载中...">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    
    <link rel="preload" href="/KTblogs/assets/css/0.styles.dae10423.css" as="style"><link rel="preload" href="/KTblogs/assets/js/app.1209f32c.js" as="script"><link rel="preload" href="/KTblogs/assets/js/4.fdeda5c7.js" as="script"><link rel="preload" href="/KTblogs/assets/js/1.a007e6af.js" as="script"><link rel="preload" href="/KTblogs/assets/js/17.53081146.js" as="script"><link rel="preload" href="/KTblogs/assets/js/12.7cad707f.js" as="script"><link rel="prefetch" href="/KTblogs/assets/js/10.4c1bb3b5.js"><link rel="prefetch" href="/KTblogs/assets/js/11.33f2f190.js"><link rel="prefetch" href="/KTblogs/assets/js/13.772f6549.js"><link rel="prefetch" href="/KTblogs/assets/js/14.afaf0d5d.js"><link rel="prefetch" href="/KTblogs/assets/js/15.743e3229.js"><link rel="prefetch" href="/KTblogs/assets/js/16.2e93ce25.js"><link rel="prefetch" href="/KTblogs/assets/js/18.8e4a5cf6.js"><link rel="prefetch" href="/KTblogs/assets/js/19.3bc54c14.js"><link rel="prefetch" href="/KTblogs/assets/js/2.3894bcd5.js"><link rel="prefetch" href="/KTblogs/assets/js/20.3b3e6cff.js"><link rel="prefetch" href="/KTblogs/assets/js/5.fb8d4ad6.js"><link rel="prefetch" href="/KTblogs/assets/js/6.11b6c1ed.js"><link rel="prefetch" href="/KTblogs/assets/js/7.9f93f4d2.js"><link rel="prefetch" href="/KTblogs/assets/js/8.2c391b26.js"><link rel="prefetch" href="/KTblogs/assets/js/9.7b091b10.js">
    <link rel="stylesheet" href="/KTblogs/assets/css/0.styles.dae10423.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container" data-v-edf8551e><div data-v-edf8551e><div id="loader-wrapper" class="loading-wrapper" data-v-d48f4d20 data-v-edf8551e data-v-edf8551e><div class="loader-main" data-v-d48f4d20><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div></div> <!----> <!----></div> <div class="password-shadow password-wrapper-out" style="display:none;" data-v-24de1186 data-v-edf8551e data-v-edf8551e><h3 class="title" data-v-24de1186 data-v-24de1186>KTBlog</h3> <p class="description" data-v-24de1186 data-v-24de1186>正在努力加载中...</p> <label id="box" class="inputBox" data-v-24de1186 data-v-24de1186><input type="password" value="" data-v-24de1186> <span data-v-24de1186>Konck! Knock!</span> <button data-v-24de1186>OK</button></label> <div class="footer" data-v-24de1186 data-v-24de1186><span data-v-24de1186><i class="iconfont reco-theme" data-v-24de1186></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-24de1186>vuePress-theme-reco</a></span> <span data-v-24de1186><i class="iconfont reco-copyright" data-v-24de1186></i> <a data-v-24de1186><span data-v-24de1186>KT</span>
            
          <span data-v-24de1186>2021 - </span>
          2022
        </a></span></div></div> <div class="hide" data-v-edf8551e><header class="navbar" data-v-edf8551e><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/KTblogs/" class="home-link router-link-active"><img src="/KTblogs/dog.jpg" alt="KTBlog" class="logo"> <span class="site-name">KTBlog</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/KTblogs/" class="nav-link"><i class="iconfont reco-home"></i>
  主页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      技术栈
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/KTblogs/categories/Vuepress/" class="nav-link"><i class="undefined"></i>
  Vuepress
</a></li><li class="dropdown-item"><!----> <a href="/KTblogs/categories/随笔/" class="nav-link"><i class="undefined"></i>
  随笔
</a></li><li class="dropdown-item"><!----> <a href="/KTblogs/categories/Vue/" class="nav-link"><i class="undefined"></i>
  Vue
</a></li><li class="dropdown-item"><!----> <a href="/KTblogs/categories/Git/" class="nav-link"><i class="undefined"></i>
  Git
</a></li></ul></div></div><div class="nav-item"><a href="/KTblogs/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/KTblogs/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间轴
</a></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-edf8551e></div> <aside class="sidebar" data-v-edf8551e><div class="personal-info-wrapper" data-v-29bd5bbe data-v-edf8551e><img src="/KTblogs/dog.jpg" alt="author-avatar" class="personal-img" data-v-29bd5bbe> <h3 class="name" data-v-29bd5bbe>
    KT
  </h3> <div class="num" data-v-29bd5bbe><div data-v-29bd5bbe><h3 data-v-29bd5bbe>6</h3> <h6 data-v-29bd5bbe>文章</h6></div> <div data-v-29bd5bbe><h3 data-v-29bd5bbe>4</h3> <h6 data-v-29bd5bbe>标签</h6></div></div> <ul class="social-links" data-v-29bd5bbe></ul> <hr data-v-29bd5bbe></div> <nav class="nav-links"><div class="nav-item"><a href="/KTblogs/" class="nav-link"><i class="iconfont reco-home"></i>
  主页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      技术栈
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/KTblogs/categories/Vuepress/" class="nav-link"><i class="undefined"></i>
  Vuepress
</a></li><li class="dropdown-item"><!----> <a href="/KTblogs/categories/随笔/" class="nav-link"><i class="undefined"></i>
  随笔
</a></li><li class="dropdown-item"><!----> <a href="/KTblogs/categories/Vue/" class="nav-link"><i class="undefined"></i>
  Vue
</a></li><li class="dropdown-item"><!----> <a href="/KTblogs/categories/Git/" class="nav-link"><i class="undefined"></i>
  Git
</a></li></ul></div></div><div class="nav-item"><a href="/KTblogs/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/KTblogs/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间轴
</a></div> <!----></nav> <ul class="sidebar-links"><li><a href="/KTblogs/docs/blog/course.html" class="sidebar-link">Vuepress博客搭建教程</a></li><li><a href="/KTblogs/docs/blog/configuration.html" aria-current="page" class="active sidebar-link">Vuepress博客相关配置</a></li></ul> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-24de1186 data-v-edf8551e><h3 class="title" data-v-24de1186 data-v-24de1186>Vuepress博客相关配置</h3> <!----> <label id="box" class="inputBox" data-v-24de1186 data-v-24de1186><input type="password" value="" data-v-24de1186> <span data-v-24de1186>Konck! Knock!</span> <button data-v-24de1186>OK</button></label> <div class="footer" data-v-24de1186 data-v-24de1186><span data-v-24de1186><i class="iconfont reco-theme" data-v-24de1186></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-24de1186>vuePress-theme-reco</a></span> <span data-v-24de1186><i class="iconfont reco-copyright" data-v-24de1186></i> <a data-v-24de1186><span data-v-24de1186>KT</span>
            
          <span data-v-24de1186>2021 - </span>
          2022
        </a></span></div></div> <div data-v-edf8551e><main class="page"><section><div class="page-title"><h1 class="title">Vuepress博客相关配置</h1> <div data-v-6b827e97><i class="iconfont reco-account" data-v-6b827e97><span data-v-6b827e97>KT</span></i> <i class="iconfont reco-date" data-v-6b827e97><span data-v-6b827e97>2021/12/23</span></i> <i class="iconfont reco-eye" data-v-6b827e97><span id="/KTblogs/docs/blog/configuration.html" data-flag-title="Your Article Title" class="leancloud-visitors" data-v-6b827e97><a class="leancloud-visitors-count" style="font-size:.9rem;font-weight:normal;color:#999;"></a></span></i> <i class="tags iconfont reco-tag" data-v-6b827e97><span class="tag-item" data-v-6b827e97>Vuepress</span></i></div></div> <div class="theme-reco-content content__default"><p>关于本博客的配置，借鉴了好多大佬优秀博客的案例，其中相关配置如下：</p> <h2 id="相关配置"><a href="#相关配置" class="header-anchor">#</a> 相关配置</h2> <div class="language- line-numbers-mode"><pre class="language-text"><code>vuepress-plugin-meting: 音乐播放器
vuepress-reco/vuepress-plugin-kan-ban-niang: 看板娘
vuepress-plugin-auto-sidebar： 自动生成侧边栏分组
vuepress/last-updated（依托于 git commit）： 文章最后更新时间转换
vue-canvas-effect（Bubbles）： 气泡
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h2 id="音乐播放器"><a href="#音乐播放器" class="header-anchor">#</a> 音乐播放器</h2> <p>本篇博客选择的meting音乐播放器插件，看个人喜好来选择了</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>npm i vuepress-plugin-meting -D
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>在.config.js文件中的plugins配置选项下配置：</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token comment">// 音乐播放器</span>
    <span class="token punctuation">[</span>
      <span class="token string">&quot;meting&quot;</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span>
        meting<span class="token operator">:</span> <span class="token punctuation">{</span>
          <span class="token comment">// 网易</span>
          server<span class="token operator">:</span> <span class="token string">&quot;netease&quot;</span><span class="token punctuation">,</span>
          <span class="token comment">// 读取歌单列表</span>
          type<span class="token operator">:</span> <span class="token string">&quot;playlist&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 歌单选项</span>
          mid<span class="token operator">:</span> <span class="token string">&quot;3136952023&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 网易歌单id</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token comment">// 不配置该项的话不会出现全局播放器</span>
        aplayer<span class="token operator">:</span> <span class="token punctuation">{</span>
          <span class="token comment">// 吸底模式</span>
          fixed<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
          mini<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
          <span class="token comment">// 自动播放</span>
          autoplay<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
          <span class="token comment">// 歌曲栏折叠</span>
          listFolded<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
          <span class="token comment">// 颜色</span>
          theme<span class="token operator">:</span> <span class="token string">&quot;#f9bcdd&quot;</span><span class="token punctuation">,</span>
          <span class="token comment">// 播放顺序为随机</span>
          order<span class="token operator">:</span> <span class="token string">&quot;random&quot;</span><span class="token punctuation">,</span>
          <span class="token comment">// 初始音量</span>
          volume<span class="token operator">:</span> <span class="token number">0.1</span><span class="token punctuation">,</span>
          <span class="token comment">// 关闭歌词显示</span>
          lrcType<span class="token operator">:</span> <span class="token number">0</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        mobile<span class="token operator">:</span> <span class="token punctuation">{</span>
          <span class="token comment">// 手机端去掉cover图</span>
          cover<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">]</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br></div></div><p><strong>提示</strong></p> <p>关于网易歌单id的获取问题，手机端的话点击进去歌单后点击分享按钮：</p> <p>然后点击复制链接，随便找个浏览器将地址复制进去就可以看见id了，如：</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>分享云音乐私人雷达的歌单《今天从《这世界那么多人》听起|私人雷达》https://y.music.163.com/m/playlist?app_version=8.6.25&amp;id=3136952023&amp;userid=317019440&amp;creatorId=1287293193 (@网易云音乐)
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>浏览器的话直接点开网易云音乐官网，随便打开一个歌单，在上方url上就可以看到id了</p> <p><img src="/jietu.png" alt="在这里插入图片描述"></p> <p>详细配置可以参考<a href="https://npmmirror.com/package/vuepress-plugin-meting" target="_blank" rel="noopener noreferrer">这里<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h2 id="看板娘"><a href="#看板娘" class="header-anchor">#</a> 看板娘</h2> <p>看板娘用官网的就可以</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>npm i @vuepress-reco/vuepress-plugin-kan-ban-niang
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token comment">// 看板娘</span>
  <span class="token punctuation">[</span>
    <span class="token string">&quot;@vuepress-reco/vuepress-plugin-kan-ban-niang&quot;</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
      clean<span class="token operator">:</span> <span class="token boolean">true</span> <span class="token comment">// 隐藏所有按钮</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token punctuation">]</span><span class="token punctuation">,</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p>具体配置可以参考<a href="https://www.npmjs.com/package/@vuepress-reco/vuepress-plugin-kan-ban-niang" target="_blank" rel="noopener noreferrer">这里<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h2 id="鼠标点击效果"><a href="#鼠标点击效果" class="header-anchor">#</a> 鼠标点击效果</h2> <div class="language- line-numbers-mode"><pre class="language-text"><code>npm i vuepress-plugin-cursor-effects
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token comment">// 鼠标特效</span>
    <span class="token punctuation">[</span>
      <span class="token string">&quot;vuepress-plugin-cursor-effects&quot;</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span>
        size<span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>                    <span class="token comment">// size of the particle, default: 2</span>
        shape<span class="token operator">:</span> <span class="token string">'circle'</span><span class="token punctuation">,</span>  <span class="token comment">// shape of the particle, default: 'star'</span>
        zIndex<span class="token operator">:</span> <span class="token number">999999999</span>           <span class="token comment">// z-index property of the canvas, default: 999999999</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><p>更多详细配置参考<a href="https://www.npmjs.com/package/vuepress-plugin-cursor-effects" target="_blank" rel="noopener noreferrer">这里<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h2 id="首页背景整屏显示"><a href="#首页背景整屏显示" class="header-anchor">#</a> 首页背景整屏显示</h2> <p>在说气泡之前先将整屏背景说一下，首页图片我们都知道是在根目录下的README.md文件中配置的，那么我们只需要对这个背景图片进行css样式的处理就可以，代码如下：</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token operator">--</span><span class="token operator">-</span>
home<span class="token operator">:</span> <span class="token boolean">true</span>
heroText<span class="token operator">:</span> 北巷花陌
tagline<span class="token operator">:</span> <span class="token string">&quot;不积跬步，无以至千里&quot;</span>
heroImageStyle<span class="token operator">:</span> <span class="token punctuation">{</span>
  maxWidth<span class="token operator">:</span> <span class="token string">'600px'</span><span class="token punctuation">,</span>
  width<span class="token operator">:</span> <span class="token string">'100%'</span><span class="token punctuation">,</span>
  display<span class="token operator">:</span> block<span class="token punctuation">,</span>
  margin<span class="token operator">:</span> <span class="token string">'9rem auto 2rem'</span><span class="token punctuation">,</span>
  background<span class="token operator">:</span> <span class="token string">'#fff'</span><span class="token punctuation">,</span>
  borderRadius<span class="token operator">:</span> <span class="token string">'1rem'</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
bgImage<span class="token operator">:</span> <span class="token string">'/cat.jpg'</span>
bgImageStyle<span class="token operator">:</span> <span class="token punctuation">{</span>
  height<span class="token operator">:</span> <span class="token string">'95vh'</span>
<span class="token punctuation">}</span>
<span class="token operator">--</span><span class="token operator">-</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br></div></div><p><strong>注意</strong></p> <p>一定要带着上下那几个横，没有这个东西，语法不成立且这段代码一定要在最上面，前面不能有任何东西,bgImageStyle这个属性里面高度height可以是94vh也可以是95vh，刚好撑满</p> <h2 id="首页气泡"><a href="#首页气泡" class="header-anchor">#</a> 首页气泡</h2> <p>先安装依赖</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>npm install vue-canvas-effect --save
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><div class="custom-block tip"><p class="title">关于</p><p>下载下来插件并不是只要配置就行，需要去修改源码，这就牵扯到了将主题源码本地化</p></div><p>在启动时，如果config没指定，系统会默认会检查.vuepress/theme，如果还没有就，直接用默认主题。
所以只要把下载(或者直接从node_modules中复制)下来的文件夹更名为theme，粘贴至 .vuepress文件夹下即可，如果在执行编译过程中，看到tip Apply local theme at xxx\Desktop\blog.vuepress\theme...相关提示，就说明从theme文件夹启动成功，该部分目录结构如下：</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>.vuepress   // 配置目录
├── public // 静态资源
├── theme // 主题(这就是复制出来的源码文件)
│   ├── components // 组件
│   ├── global-components // 全局组件
│   ├── layouts // 布局(包括首页在内)
│   ├── styles // 样式
│   ├── util // 工具
│   ├── index.js // 入口配置
│   ├── noopModule.js // 依赖注入
│   ├── package.json // 主题依赖
│   ├── README.md // 主题说明
└── config.js
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br></div></div><p>将目录格式弄成上述结构后就可以开始添加气泡了,直接找到theme/components/HomeBlog/index.vue</p> <p>首先现在methods方法上方部位添加</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code>  <span class="token function">mounted</span> <span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword">import</span><span class="token punctuation">(</span><span class="token string">'vue-canvas-effect/src/components/bubbles'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">then</span><span class="token punctuation">(</span><span class="token parameter">module</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>bubbles<span class="token operator">=</span>module<span class="token punctuation">.</span>default
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>recoShow <span class="token operator">=</span> <span class="token boolean">true</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">_setPage</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">_getStoragePage</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p>然后再27行添加</p> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>component</span> <span class="token attr-name">v-if</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>bubbles<span class="token punctuation">&quot;</span></span> <span class="token attr-name">:is</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>bubbles<span class="token punctuation">&quot;</span></span> <span class="token attr-name">:options</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>options<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>component</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>最后在components所在行下一行加入</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code>  <span class="token function">data</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">{</span>
      recoShow<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
      currentPage<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
      tags<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
      bubbles<span class="token operator">:</span> <span class="token keyword">null</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><p>完整的文件内容(不包含css)如下:</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token operator">&lt;</span>template<span class="token operator">&gt;</span>
  <span class="token operator">&lt;</span>div <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;home-blog&quot;</span><span class="token operator">&gt;</span>
    <span class="token operator">&lt;</span>div <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;hero&quot;</span> <span class="token operator">:</span>style<span class="token operator">=</span><span class="token string">&quot;{ ...bgImageStyle }&quot;</span><span class="token operator">&gt;</span>
      <span class="token operator">&lt;</span>div<span class="token operator">&gt;</span>
        <span class="token operator">&lt;</span>ModuleTransition<span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>img
            <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;hero-img&quot;</span>
            v<span class="token operator">-</span><span class="token keyword">if</span><span class="token operator">=</span><span class="token string">&quot;recoShowModule &amp;&amp; $frontmatter.heroImage&quot;</span>
            <span class="token operator">:</span>style<span class="token operator">=</span><span class="token string">&quot;heroImageStyle || {}&quot;</span>
            <span class="token operator">:</span>src<span class="token operator">=</span><span class="token string">&quot;$withBase($frontmatter.heroImage)&quot;</span>
            alt<span class="token operator">=</span><span class="token string">&quot;hero&quot;</span>
          <span class="token operator">/</span><span class="token operator">&gt;</span>
        <span class="token operator">&lt;</span><span class="token operator">/</span>ModuleTransition<span class="token operator">&gt;</span>

        <span class="token operator">&lt;</span>ModuleTransition delay<span class="token operator">=</span><span class="token string">&quot;0.04&quot;</span><span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>h1 v<span class="token operator">-</span><span class="token keyword">if</span><span class="token operator">=</span><span class="token string">&quot;recoShowModule &amp;&amp; $frontmatter.heroText !== null&quot;</span><span class="token operator">&gt;</span>
            <span class="token punctuation">{</span><span class="token punctuation">{</span> $frontmatter<span class="token punctuation">.</span>heroText <span class="token operator">||</span> $title <span class="token operator">||</span> <span class="token string">'vuePress-theme-reco'</span> <span class="token punctuation">}</span><span class="token punctuation">}</span>
          <span class="token operator">&lt;</span><span class="token operator">/</span>h1<span class="token operator">&gt;</span>
        <span class="token operator">&lt;</span><span class="token operator">/</span>ModuleTransition<span class="token operator">&gt;</span>

        <span class="token operator">&lt;</span>ModuleTransition delay<span class="token operator">=</span><span class="token string">&quot;0.08&quot;</span><span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>p v<span class="token operator">-</span><span class="token keyword">if</span><span class="token operator">=</span><span class="token string">&quot;recoShowModule &amp;&amp; $frontmatter.tagline !== null&quot;</span> <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;description&quot;</span><span class="token operator">&gt;</span>
            <span class="token punctuation">{</span><span class="token punctuation">{</span> $frontmatter<span class="token punctuation">.</span>tagline <span class="token operator">||</span> $description <span class="token operator">||</span> <span class="token string">'Welcome to your vuePress-theme-reco site'</span> <span class="token punctuation">}</span><span class="token punctuation">}</span>
          <span class="token operator">&lt;</span><span class="token operator">/</span>p<span class="token operator">&gt;</span>
        <span class="token operator">&lt;</span><span class="token operator">/</span>ModuleTransition<span class="token operator">&gt;</span>
      <span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span>
      <span class="token operator">&lt;</span>component v<span class="token operator">-</span><span class="token keyword">if</span><span class="token operator">=</span><span class="token string">&quot;bubbles&quot;</span> <span class="token operator">:</span>is<span class="token operator">=</span><span class="token string">&quot;bubbles&quot;</span> <span class="token operator">:</span>options<span class="token operator">=</span><span class="token string">&quot;options&quot;</span><span class="token operator">&gt;</span><span class="token operator">&lt;</span><span class="token operator">/</span>component<span class="token operator">&gt;</span>
    <span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span>

    <span class="token operator">&lt;</span>ModuleTransition delay<span class="token operator">=</span><span class="token string">&quot;0.16&quot;</span><span class="token operator">&gt;</span>
      <span class="token operator">&lt;</span>div v<span class="token operator">-</span>show<span class="token operator">=</span><span class="token string">&quot;recoShowModule&quot;</span> <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;home-blog-wrapper&quot;</span><span class="token operator">&gt;</span>
        <span class="token operator">&lt;</span>div <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;blog-list&quot;</span><span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span><span class="token operator">!</span><span class="token operator">--</span> 博客列表 <span class="token operator">--</span><span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>note<span class="token operator">-</span>abstract <span class="token operator">:</span>data<span class="token operator">=</span><span class="token string">&quot;$recoPosts&quot;</span> @paginationChange<span class="token operator">=</span><span class="token string">&quot;paginationChange&quot;</span> <span class="token operator">/</span><span class="token operator">&gt;</span>
        <span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span>
        <span class="token operator">&lt;</span>div <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;info-wrapper&quot;</span><span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>PersonalInfo<span class="token operator">/</span><span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>h4<span class="token operator">&gt;</span><span class="token operator">&lt;</span>reco<span class="token operator">-</span>icon icon<span class="token operator">=</span><span class="token string">&quot;reco-category&quot;</span> <span class="token operator">/</span><span class="token operator">&gt;</span> <span class="token punctuation">{</span><span class="token punctuation">{</span>$recoLocales<span class="token punctuation">.</span>category<span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token operator">&lt;</span><span class="token operator">/</span>h4<span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>ul <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;category-wrapper&quot;</span><span class="token operator">&gt;</span>
            <span class="token operator">&lt;</span>li <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;category-item&quot;</span> v<span class="token operator">-</span><span class="token keyword">for</span><span class="token operator">=</span><span class="token string">&quot;(item, index) in this.$categories.list&quot;</span> <span class="token operator">:</span>key<span class="token operator">=</span><span class="token string">&quot;index&quot;</span><span class="token operator">&gt;</span>
              <span class="token operator">&lt;</span>router<span class="token operator">-</span>link <span class="token operator">:</span>to<span class="token operator">=</span><span class="token string">&quot;item.path&quot;</span><span class="token operator">&gt;</span>
                <span class="token operator">&lt;</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;category-name&quot;</span><span class="token operator">&gt;</span><span class="token punctuation">{</span><span class="token punctuation">{</span> item<span class="token punctuation">.</span>name <span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token operator">&lt;</span><span class="token operator">/</span>span<span class="token operator">&gt;</span>
                <span class="token operator">&lt;</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;post-num&quot;</span> <span class="token operator">:</span>style<span class="token operator">=</span><span class="token string">&quot;{ 'backgroundColor': getOneColor() }&quot;</span><span class="token operator">&gt;</span><span class="token punctuation">{</span><span class="token punctuation">{</span> item<span class="token punctuation">.</span>pages<span class="token punctuation">.</span>length <span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token operator">&lt;</span><span class="token operator">/</span>span<span class="token operator">&gt;</span>
              <span class="token operator">&lt;</span><span class="token operator">/</span>router<span class="token operator">-</span>link<span class="token operator">&gt;</span>
            <span class="token operator">&lt;</span><span class="token operator">/</span>li<span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span><span class="token operator">/</span>ul<span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>hr<span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>h4 v<span class="token operator">-</span><span class="token keyword">if</span><span class="token operator">=</span><span class="token string">&quot;$tags.list.length !== 0&quot;</span><span class="token operator">&gt;</span><span class="token operator">&lt;</span>reco<span class="token operator">-</span>icon icon<span class="token operator">=</span><span class="token string">&quot;reco-tag&quot;</span> <span class="token operator">/</span><span class="token operator">&gt;</span> <span class="token punctuation">{</span><span class="token punctuation">{</span>$recoLocales<span class="token punctuation">.</span>tag<span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token operator">&lt;</span><span class="token operator">/</span>h4<span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>TagList @getCurrentTag<span class="token operator">=</span><span class="token string">&quot;getPagesByTags&quot;</span> <span class="token operator">/</span><span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>h4 v<span class="token operator">-</span><span class="token keyword">if</span><span class="token operator">=</span><span class="token string">&quot;$themeConfig.friendLink &amp;&amp; $themeConfig.friendLink.length !== 0&quot;</span><span class="token operator">&gt;</span><span class="token operator">&lt;</span>reco<span class="token operator">-</span>icon icon<span class="token operator">=</span><span class="token string">&quot;reco-friend&quot;</span> <span class="token operator">/</span><span class="token operator">&gt;</span> <span class="token punctuation">{</span><span class="token punctuation">{</span>$recoLocales<span class="token punctuation">.</span>friendLink<span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token operator">&lt;</span><span class="token operator">/</span>h4<span class="token operator">&gt;</span>
          <span class="token operator">&lt;</span>FriendLink <span class="token operator">/</span><span class="token operator">&gt;</span>
        <span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span>
      <span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span>
    <span class="token operator">&lt;</span><span class="token operator">/</span>ModuleTransition<span class="token operator">&gt;</span>

    <span class="token operator">&lt;</span>ModuleTransition delay<span class="token operator">=</span><span class="token string">&quot;0.24&quot;</span><span class="token operator">&gt;</span>
      <span class="token operator">&lt;</span>Content v<span class="token operator">-</span>show<span class="token operator">=</span><span class="token string">&quot;recoShowModule&quot;</span> <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">&quot;home-center&quot;</span> custom<span class="token operator">/</span><span class="token operator">&gt;</span>
    <span class="token operator">&lt;</span><span class="token operator">/</span>ModuleTransition<span class="token operator">&gt;</span>
  <span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span>
<span class="token operator">&lt;</span><span class="token operator">/</span>template<span class="token operator">&gt;</span>

<span class="token operator">&lt;</span>script<span class="token operator">&gt;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> defineComponent<span class="token punctuation">,</span> toRefs<span class="token punctuation">,</span> reactive<span class="token punctuation">,</span> computed<span class="token punctuation">,</span> onMounted <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'vue-demi'</span>
<span class="token keyword">import</span> TagList <span class="token keyword">from</span> <span class="token string">'@theme/components/TagList'</span>
<span class="token keyword">import</span> FriendLink <span class="token keyword">from</span> <span class="token string">'@theme/components/FriendLink'</span>
<span class="token keyword">import</span> NoteAbstract <span class="token keyword">from</span> <span class="token string">'@theme/components/NoteAbstract'</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> ModuleTransition<span class="token punctuation">,</span> RecoIcon <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@vuepress-reco/core/lib/components'</span>
<span class="token keyword">import</span> PersonalInfo <span class="token keyword">from</span> <span class="token string">'@theme/components/PersonalInfo'</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> getOneColor <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@theme/helpers/other'</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> useInstance <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@theme/helpers/composable'</span>

<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token function">defineComponent</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
  components<span class="token operator">:</span> <span class="token punctuation">{</span> NoteAbstract<span class="token punctuation">,</span> TagList<span class="token punctuation">,</span> FriendLink<span class="token punctuation">,</span> ModuleTransition<span class="token punctuation">,</span> PersonalInfo<span class="token punctuation">,</span> RecoIcon <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">data</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">{</span>
      recoShow<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
      currentPage<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
      tags<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
      bubbles<span class="token operator">:</span> <span class="token keyword">null</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">setup</span> <span class="token punctuation">(</span><span class="token parameter">props<span class="token punctuation">,</span> ctx</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">const</span> instance <span class="token operator">=</span> <span class="token function">useInstance</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

    <span class="token keyword">const</span> state <span class="token operator">=</span> <span class="token function">reactive</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
      recoShow<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
      heroHeight<span class="token operator">:</span> <span class="token number">0</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>

    <span class="token keyword">const</span> recoShowModule <span class="token operator">=</span> <span class="token function">computed</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> instance <span class="token operator">&amp;&amp;</span> instance<span class="token punctuation">.</span>$parent<span class="token punctuation">.</span>recoShowModule<span class="token punctuation">)</span>

    <span class="token keyword">const</span> heroImageStyle <span class="token operator">=</span> <span class="token function">computed</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> instance<span class="token punctuation">.</span>$frontmatter<span class="token punctuation">.</span>heroImageStyle <span class="token operator">||</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span>

    <span class="token keyword">const</span> bgImageStyle <span class="token operator">=</span> <span class="token function">computed</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
      <span class="token keyword">const</span> url <span class="token operator">=</span> instance<span class="token punctuation">.</span>$frontmatter<span class="token punctuation">.</span>bgImage
        <span class="token operator">?</span> instance<span class="token punctuation">.</span><span class="token function">$withBase</span><span class="token punctuation">(</span>instance<span class="token punctuation">.</span>$frontmatter<span class="token punctuation">.</span>bgImage<span class="token punctuation">)</span>
        <span class="token operator">:</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'../../images/bg.svg'</span><span class="token punctuation">)</span>

      <span class="token keyword">const</span> initBgImageStyle <span class="token operator">=</span> <span class="token punctuation">{</span>
        textAlign<span class="token operator">:</span> <span class="token string">'center'</span><span class="token punctuation">,</span>
        overflow<span class="token operator">:</span> <span class="token string">'hidden'</span><span class="token punctuation">,</span>
        background<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">url(</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>url<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">) center/cover no-repeat</span><span class="token template-punctuation string">`</span></span>
      <span class="token punctuation">}</span>

      <span class="token keyword">const</span> <span class="token punctuation">{</span> bgImageStyle <span class="token punctuation">}</span> <span class="token operator">=</span> instance<span class="token punctuation">.</span>$frontmatter

      <span class="token keyword">return</span> bgImageStyle <span class="token operator">?</span> <span class="token punctuation">{</span> <span class="token operator">...</span>initBgImageStyle<span class="token punctuation">,</span> <span class="token operator">...</span>bgImageStyle <span class="token punctuation">}</span> <span class="token operator">:</span> initBgImageStyle
    <span class="token punctuation">}</span><span class="token punctuation">)</span>

    <span class="token function">onMounted</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
      state<span class="token punctuation">.</span>heroHeight <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelector</span><span class="token punctuation">(</span><span class="token string">'.hero'</span><span class="token punctuation">)</span><span class="token punctuation">.</span>clientHeight
      state<span class="token punctuation">.</span>recoShow <span class="token operator">=</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>

    <span class="token keyword">return</span> <span class="token punctuation">{</span> recoShowModule<span class="token punctuation">,</span> heroImageStyle<span class="token punctuation">,</span> bgImageStyle<span class="token punctuation">,</span> <span class="token operator">...</span><span class="token function">toRefs</span><span class="token punctuation">(</span>state<span class="token punctuation">)</span><span class="token punctuation">,</span> getOneColor <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">mounted</span> <span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword">import</span><span class="token punctuation">(</span><span class="token string">'vue-canvas-effect/src/components/bubbles'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">then</span><span class="token punctuation">(</span><span class="token parameter">module</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>bubbles<span class="token operator">=</span>module<span class="token punctuation">.</span>default
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>recoShow <span class="token operator">=</span> <span class="token boolean">true</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">_setPage</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">_getStoragePage</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  methods<span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token function">paginationChange</span> <span class="token punctuation">(</span><span class="token parameter">page</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
        window<span class="token punctuation">.</span><span class="token function">scrollTo</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">.</span>heroHeight<span class="token punctuation">)</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">100</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">getPagesByTags</span> <span class="token punctuation">(</span><span class="token parameter">tagInfo</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>$router<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token punctuation">{</span> path<span class="token operator">:</span> tagInfo<span class="token punctuation">.</span>path <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token operator">&lt;</span><span class="token operator">/</span>script<span class="token operator">&gt;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br><span class="line-number">97</span><br><span class="line-number">98</span><br><span class="line-number">99</span><br><span class="line-number">100</span><br><span class="line-number">101</span><br><span class="line-number">102</span><br><span class="line-number">103</span><br><span class="line-number">104</span><br><span class="line-number">105</span><br><span class="line-number">106</span><br><span class="line-number">107</span><br><span class="line-number">108</span><br><span class="line-number">109</span><br><span class="line-number">110</span><br><span class="line-number">111</span><br><span class="line-number">112</span><br><span class="line-number">113</span><br><span class="line-number">114</span><br><span class="line-number">115</span><br><span class="line-number">116</span><br><span class="line-number">117</span><br><span class="line-number">118</span><br><span class="line-number">119</span><br><span class="line-number">120</span><br><span class="line-number">121</span><br><span class="line-number">122</span><br><span class="line-number">123</span><br><span class="line-number">124</span><br><span class="line-number">125</span><br><span class="line-number">126</span><br><span class="line-number">127</span><br><span class="line-number">128</span><br><span class="line-number">129</span><br><span class="line-number">130</span><br><span class="line-number">131</span><br><span class="line-number">132</span><br><span class="line-number">133</span><br><span class="line-number">134</span><br><span class="line-number">135</span><br></div></div><p>效果如下：</p> <p><img src="/shouye.jpg" alt="在这里插入图片描述"></p> <h2 id="自动生成侧边栏分组"><a href="#自动生成侧边栏分组" class="header-anchor">#</a> 自动生成侧边栏分组</h2> <p>直接找到.config文件，在themeConfig配置项下加上：</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code>  <span class="token string">&quot;subSidebar&quot;</span><span class="token operator">:</span> <span class="token string">'auto'</span><span class="token punctuation">,</span>
    <span class="token string">&quot;sidebar&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
      <span class="token string">&quot;/docs/Web/git/&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token string">&quot;git&quot;</span><span class="token punctuation">,</span>
      <span class="token punctuation">]</span><span class="token punctuation">,</span>
      <span class="token string">&quot;/docs/Web/vue/&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token string">&quot;vueRef&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;provide&quot;</span>
      <span class="token punctuation">]</span><span class="token punctuation">,</span>
      <span class="token string">&quot;/docs/blog/&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token string">&quot;course&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;configuration&quot;</span>
      <span class="token punctuation">]</span><span class="token punctuation">,</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br></div></div><p>最后更新时间和自动生成侧边栏分组具体的可以参照官网的<a href="https://vuepress-theme-reco.recoluan.com/views/1.x/" target="_blank" rel="noopener noreferrer">配置<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p></div></section> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新时间: </span> <span class="time">2021/12/23 下午10:53:17</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"><a href="/KTblogs/docs/blog/course.html" class="prev">
            Vuepress博客搭建教程
          </a></span> <!----></p></div> <div class="comments-wrapper"><!----></div> <ul class="side-bar sub-sidebar-wrapper" style="width:12rem;" data-v-1ab38110><li class="level-2" data-v-1ab38110><a href="/KTblogs/docs/blog/configuration.html#相关配置" class="sidebar-link reco-side-相关配置" data-v-1ab38110>相关配置</a></li><li class="level-2" data-v-1ab38110><a href="/KTblogs/docs/blog/configuration.html#音乐播放器" class="sidebar-link reco-side-音乐播放器" data-v-1ab38110>音乐播放器</a></li><li class="level-2" data-v-1ab38110><a href="/KTblogs/docs/blog/configuration.html#看板娘" class="sidebar-link reco-side-看板娘" data-v-1ab38110>看板娘</a></li><li class="level-2" data-v-1ab38110><a href="/KTblogs/docs/blog/configuration.html#鼠标点击效果" class="sidebar-link reco-side-鼠标点击效果" data-v-1ab38110>鼠标点击效果</a></li><li class="level-2" data-v-1ab38110><a href="/KTblogs/docs/blog/configuration.html#首页背景整屏显示" class="sidebar-link reco-side-首页背景整屏显示" data-v-1ab38110>首页背景整屏显示</a></li><li class="level-2" data-v-1ab38110><a href="/KTblogs/docs/blog/configuration.html#首页气泡" class="sidebar-link reco-side-首页气泡" data-v-1ab38110>首页气泡</a></li><li class="level-2" data-v-1ab38110><a href="/KTblogs/docs/blog/configuration.html#自动生成侧边栏分组" class="sidebar-link reco-side-自动生成侧边栏分组" data-v-1ab38110>自动生成侧边栏分组</a></li></ul></main> <!----></div></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;display:none;" data-v-c6073ba8 data-v-c6073ba8><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-c6073ba8><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-c6073ba8></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-c6073ba8></path></svg></div><!----><APlayer audio="" fixed="true" mini="true" autoplay="autoplay" theme="#f9bcdd" loop="loop" order="random" preload="auto" volume="0.1" mutex="true" lrc-type="0" list-folded="true" list-max-height="250" storage-name="vuepress-plugin-meting" id="aplayer-fixed"></APlayer><div class="kanbanniang" data-v-5775ee02><div class="banniang-container" style="display:;" data-v-5775ee02><div class="messageBox" style="right:68px;bottom:190px;display:none;" data-v-5775ee02>
      欢迎来到 KTBlog
    </div> <div class="operation" style="right:90px;bottom:40px;display:none;" data-v-5775ee02><i class="kbnfont kbn-ban-home ban-home" data-v-5775ee02></i> <i class="kbnfont kbn-ban-message message" data-v-5775ee02></i> <i class="kbnfont kbn-ban-close close" data-v-5775ee02></i> <a target="_blank" href="https://vuepress-theme-reco.recoluan.com/views/plugins/kanbanniang.html" data-v-5775ee02><i class="kbnfont kbn-ban-info info" data-v-5775ee02></i></a> <i class="kbnfont kbn-ban-theme skin" style="display:;" data-v-5775ee02></i></div> <canvas id="banniang" width="150" height="220" class="live2d" style="right:90px;bottom:-20px;opacity:0.9;" data-v-5775ee02></canvas></div> <div class="showBanNiang" style="display:none;" data-v-5775ee02>
    看板娘
  </div></div><canvas id="vuepress-canvas-cursor"></canvas></div></div>
    <script src="/KTblogs/assets/js/app.1209f32c.js" defer></script><script src="/KTblogs/assets/js/4.fdeda5c7.js" defer></script><script src="/KTblogs/assets/js/1.a007e6af.js" defer></script><script src="/KTblogs/assets/js/17.53081146.js" defer></script><script src="/KTblogs/assets/js/12.7cad707f.js" defer></script>
  </body>
</html>
